//
//  LKImagePickerView.h
//  LKImagePickerDemo
//
//  Created by LIUKUN-PC on 16/5/31.
//  Copyright © 2016年 liukun. All rights reserved.
//

#import <UIKit/UIKit.h>

//图片来源
typedef NS_ENUM(NSInteger, LKImagePickerSourceType) {
    LKImagePickerSourceTypeAll = 0,              //来源于照片库和相机
    LKImagePickerSourceTypePhotosLibrary,        //只来源于照片库
    LKImagePickerSourceTypeCamera                //只来源于相机
};

@interface LKImagePickerView : UIView

/** 每一行能显示图片的最大数量, 默认为3 */
@property (nonatomic, assign) NSInteger maxCountAtSingleLine;

/** 照片的最大张数, 默认为9张 */
@property (nonatomic, assign) NSInteger maxImageCount;

/** 数据来源，默认来源于照片库和相机 */
@property (nonatomic, assign) LKImagePickerSourceType sourceType;

/** 当前控制器，用于推出其他界面 */
@property (nonatomic, weak) UIViewController *currentViewController;

/** 选择的图片 */
@property (nonatomic, strong, readonly) NSMutableArray<UIImage *> *photos;

//图片数，包括加号
@property (nonatomic, assign) NSInteger itemCount;

/**
 *  项数改变的回调
 *
 *  @param itemCountDidChangeBlock 选择的图片数量改变的回调
 */
- (void)selectedImageCountDidChangeHandler:(void(^)(NSInteger imageCount, NSInteger itemCount, CGFloat bestHeightWidthRatio))selectedImageCountDidChangeBlock;

/**
 *  创建对象工厂方法
 *
 *  @param frame                 frame
 *  @param currentViewController 当前控制器，用于推出其他界面
 *
 *  @return 实例对象
 */
+ (instancetype)imagePickerViewWithFrame:(CGRect)frame currentViewController:(UIViewController *)currentViewController;

@end

@interface LKImagePickerCollectionViewCell : UICollectionViewCell

@property (nonatomic, strong) UIImageView *imageView;

@property (nonatomic, copy) void(^deleteBlock)();

@end
